<template>
  <div class="user-article">
      <div>
          <span @click="mytalk" style="cursor: pointer;">我的留言</span>
          <span @click="Unsubscribe" style="cursor: pointer;">注销账户</span>
      </div>
      <div></div>
  </div>
</template>

<script>
export default {
     inject:["reload"],
methods: {
    Unsubscribe()  {
     localStorage.removeItem("token")
     localStorage.removeItem("id")
     localStorage.removeItem("username")
     if(!localStorage.getItem('token')) {
        this.reload()
         this.$msg.fail('注销成功')
     setTimeout(()=> {
         this.$router.push('/')
          },1000)

     }
  } ,
  mytalk() {
         let routeInfo = this.$router.resolve({ path: '/communication'});
             window.open(routeInfo.href,'_blank')
  }
}
}
</script>

<style lang="less">
.user-article{
    display: flex;
    align-items: center;
    height: 4.111vw;
    padding: 0 2.778vw;
 
    span{
        display: block;
        float: left;
        transform: translate(0, -1.5vw);
        height: 2.6vw;
        line-height: 2.6vw;
        text-align: center;
        width: 4vw;
        margin: 0 2vw;
        color: #777;
        border-bottom: 0.178vw solid rgb(0, 173, 235);
 
    }
}
</style>